package com.zm.demo.shoppingmall.gateway.service;

import com.zm.demo.shoppingmall.storage.api.StorageService;
import com.zm.demo.shoppingmall.storage.model.TStorage;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @desc:
 * @author: z01140
 * @date: 2021/5/25 10:27
 */
@Component
public class StorageManager {

    @DubboReference
    private StorageService storageService;

    public int addStorage(TStorage storage){
        return storageService.addStorage(storage);
    }

    public int updateStorage(TStorage storage){
        return storageService.updateStorage(storage);
    }

    public int deleteStorageById(int storageId){
        return storageService.deleteStorageById(storageId);
    }

    public TStorage getStorageById(int StorageId){
        return storageService.getStorageById(StorageId);
    }

    public TStorage getStorageByProductNo(String productNo, LocalDateTime date){
        return storageService.getStorageByProductNo(productNo, date);
    }

}
